﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DotDiff.TestInterface
{
    public partial class CompareSettings : Form
    {
        //private XmlCompare xmlCompare;
        private XmlSettings xmlSettings;

        public CompareSettings(XmlCompare compareEngine)
        {
            InitializeComponent();
            if (compareEngine.XmlSettings == null)
            {
                compareEngine.XmlSettings = new XmlSettings();
            }
            xmlSettings = compareEngine.XmlSettings;

            //load Xml settings
            txtIdNodeName.Text = string.IsNullOrEmpty(xmlSettings.IdNode) ? "" : xmlSettings.IdNode;
            chkXpathPosition.Checked = xmlSettings.XpathPosition;
            chkXpathAttribute.Checked = xmlSettings.XpathAttributes;
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //set the config settings
            xmlSettings.IdNode = txtIdNodeName.Text;
            xmlSettings.XpathPosition = chkXpathPosition.Checked;
            xmlSettings.XpathAttributes = chkXpathAttribute.Checked;
            this.Close();
        }

        private void CompareSettings_Load(object sender, EventArgs e)
        {

        }


    }
}
